#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void Intersection(int *p1, int *p2, int sz1,int sz2)
{
	int tmp[100] = { 0 };
	int count = 0;
	int i = 0;
	for (i = 0; i < sz1; i++)
	{
		int j = 0;
		for (j = 0; j < sz2; j++)
		{
			if ( ((*(p1 + i)) ^ (*(p2 + j))) == 0)
			{
				tmp[i] = *(p1 + i);
				count++;
			}
		}
	}
	for (i = 0; i < count; i++)
	{
		printf("%d ", tmp[i]);
	}
}

int main()
{
	int nums1[] = {4,9};
	int nums2[] = { 1,2,3,4,5,6,9 };
	int sz1 = sizeof(nums1) / sizeof(nums1[0]);
	int sz2 = sizeof(nums2) / sizeof(nums2[0]);
	Intersection(nums1, nums2, sz1, sz2);
	return 0;
}